using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using BussinessLogicLayer;

namespace QLThongTinGiaiDauBongDa.Presentation.frmPhanThuong
{
    public partial class frmQLPhanThuong : DevComponents.DotNetBar.Metro.MetroForm
    {
        public frmQLPhanThuong()
        {
            InitializeComponent();
        }

        private void btnDong_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnThemPT_Click(object sender, EventArgs e)
        {
            frmThemCapNhatPhanThuong frmTCNPT = new frmThemCapNhatPhanThuong();
            frmTCNPT.Show();
        }

        private void btnTraoPT_Click(object sender, EventArgs e)
        {
            frmTraoPhanThuong frmTPT = new frmTraoPhanThuong();
            frmTPT.Show();
        }

        private void frmQLPhanThuong_Load(object sender, EventArgs e)
        {
            cbbGiaiDau.DataSource = GiaiDauBLL.LayGiaiDau();
            cbbGiaiDau.DisplayMember = "TenGiaiDau";
            cbbGiaiDau.ValueMember = "MaGiaiDau";
            cbbGiaiDau.SelectedIndexChanged +=cbbGiaiDau_SelectedIndexChanged;
            
        }
        private void HienThiPT()
        {
            dgvPhanThuong.DataSource = PhanThuongBLL.LayPhanThuong(int.Parse(cbbGiaiDau.SelectedValue.ToString()));
            dgvPhanThuong.Columns["MaGiaiDau"].Visible = false;
            dgvPhanThuong.Columns["GiaiDau"].Visible = false;
        }

        private void cbbGiaiDau_SelectedIndexChanged(object sender, EventArgs e)
        {
            HienThiPT();
        }

    }
}